package com.ymxx.jweb.persistence.business;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.ymxx.jweb.persistence.organization.Employee;

/**
 * @author Administrator
 *	审批流
 */
@Entity
@Table(name="YMXX_APPROVE_FLOW")
public class ApproveFlow {
	public ApproveFlow() {
		super();
	}

	@Id
	@Column(name="UUID",length=128)
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	private String uuid;
	/**
	 * 为某个业务类型定义审批流程
	 */
	@ManyToOne(optional=false,fetch=FetchType.LAZY)
	@JoinColumn(name="BUSINESS_CODE",referencedColumnName="BUSINESS_CODE")
	private BusinessType businessType;
	/**
	 * 审批员
	 */
	@ManyToOne(optional=true,fetch=FetchType.LAZY)
	@JoinColumn(name="APPROVE_USER_CODE",referencedColumnName="CODE")
	private Employee approveUser;
	/**
	 * 审批级别
	 */
	@Column(name="LEVEL")
	private Integer level;
	
	/**
	 * 当前审批级别上需要同时审批的人数
	 */
	@Column(name="APPROVE_COUNT")
	private Integer approveCount;
	
	
	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public BusinessType getBusinessType() {
		return businessType;
	}

	public void setBusinessType(BusinessType businessType) {
		this.businessType = businessType;
	}

	public Employee getApproveUser() {
		return approveUser;
	}

	public void setApproveUser(Employee approveUser) {
		this.approveUser = approveUser;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getApproveCount() {
		return approveCount;
	}

	public void setApproveCount(Integer approveCount) {
		this.approveCount = approveCount;
	}
}
